<?php
    require('init.php');
    require('header.php');
    
    $trans = Transporteur::getTransporteurs();
    echo '<div id="gestion" class= "container_12">';
    echo '<a class="grid_5 alpha" href="details_transporteurs.php">
    .     <img alt="#" src="../img/ajouter.png" title="Ajouter" class="btn_ajouter" width="30"/>
          Ajouter un nouveau mode de transport</a>';
    echo '</div>';
    
    echo    '<div class= "container_12">';
    echo    '<table class="grid_12" cellspacing="0" >
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>Libelle</th>
                        <th>Téléphone</th>
                        <th>Email</th>
                        <th>Franco Port</th>
                        <th>Frais de port</th>
                        <th>Date d\'ajout</th>
                        <th>Date de modification</th>
                        <th>Valide</th>
                        <th>Gestion</th>
                    </tr>
                </thead>
                <tbody>';

    foreach($trans as $t) {
        echo        '<tr>
                        <td>
                            '.$t->getId().'
                        </td>
                        <td>
                            '.$t->getLibelle().'
                        </td>
                        <td>
                            '.$t->getTel().'
                        </td>
                        <td>
                            '.$t->getEmail().'
                        </td>
                        <td>
                            '.$t->getFrancoPort().'
                        </td>
                        <td>
                            '.$t->getFraisPort().'
                        </td>
                        <td>
                            '.$t->getDateAjout('d/m/Y H:i:s').'
                        </td>
                        <td>
                            '.$t->getDateModif('d/m/Y H:i:s').'
                        </td>
                        <td>
                            '.$t->getValide().'
                        </td>
                        <td>
                            <a href="details_transporteurs.php?id='.$t->getId().'">Gérer</a> 
                        </td>
                    </tr>';
    }
    echo        '</tbody>
            </table>
            </div>';
    
?>
